package jmine.tec.report.script;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import jmine.tec.report.api.Report;
import jmine.tec.script.ScriptLogger;
import jmine.tec.script.impl.ScriptLoggerImpl;
import jmine.tec.utils.Tuple;
import jmine.tec.utils.UnmodifiableTuple;

/**
 * Resultado de um script de criação de relatório.
 * 
 * @author lundberg
 */
public class ReportScriptResult {

    private List<Tuple<String, Report>> reports = new ArrayList<Tuple<String, Report>>();

    private ScriptLogger scriptLogger = new ScriptLoggerImpl();
    
    /**
     * @return the reports
     */
    public List<Tuple<String, Report>> getReports() {
        return Collections.unmodifiableList(this.reports);
    }

    /**
     * Adiciona um relatório ao resultado
     * 
     * @param name name
     * @param report report
     */
    public void addReport(String name, Report report) {
        this.reports.add(new UnmodifiableTuple<String, Report>(name, report));
    }

    /**
     * @param scriptLogger scriptLogger 
     */
    public void setScriptLogger(ScriptLogger scriptLogger) {
        this.scriptLogger = scriptLogger;
    }

    /**
     * @return o scriptLogger
     */
    public ScriptLogger getScriptLogger() {
        return scriptLogger;
    }

}
